﻿<phone:PhoneApplicationPage 
    x:Class="ALiteTeam.PackageTracer.View.View.ComfirmOrder"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    DataContext="{Binding ComfirmOrderViewModel, Source={StaticResource ViewModelLocator}}"
    shell:SystemTray.IsVisible="True"
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:Mvvm="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot">
        <!--设定配置好的背景图-->
        <Grid.Background>
            <ImageBrush ImageSource="{Binding BackgroundImage, Source={StaticResource ViewModelLocator}}"/>
        </Grid.Background>
        <!--Pivot Control-->
        <controls:Pivot Name="pivot" Title="风讯快递查询">
            <!--Pivot item one-->
            <controls:PivotItem x:Name="pivotItem" Header="{Binding Path=DeliveryDisplayName, Mode=OneTime}" >
                <Grid>
                    <TextBlock Height="30" HorizontalAlignment="Left" Margin="0" Name="lblOrderNumber" Text="请录入快递单号：" VerticalAlignment="Top" FontWeight="Bold" />
                    <TextBox Height="72" HorizontalAlignment="Left" Margin="0,30,0,0" Name="txbOrderNumber" Text="{Binding Path=OrderNo, Mode=TwoWay}" VerticalAlignment="Top" Width="470" IsEnabled="False" />
                    <Button Content="上一步" Height="72" HorizontalAlignment="Right" Margin="0,489,270,0" Name="btnPrevious" VerticalAlignment="Top" Width="130" Command="{Binding GoBackCommand}" />
                    <Button Content="完成" Height="72" HorizontalAlignment="Right" Margin="0,489,80,0" Name="btnNext" VerticalAlignment="Top" Width="130" Command="{Binding SubmitCommand}" />
                    <TextBlock Height="30" HorizontalAlignment="Left" Margin="0,115,0,0" Name="textBlock1" Text="请录入简要描述（摘要标题）：" VerticalAlignment="Top" FontWeight="Bold" />
                    <TextBox Height="72" HorizontalAlignment="Left" IsEnabled="True" Margin="0,145,0,0" Name="txbTitle" Text="{Binding Path=Title, Mode=TwoWay}" VerticalAlignment="Top" Width="470">
                        <Custom:Interaction.Triggers>
                            <Custom:EventTrigger EventName="GotFocus">
                                <Mvvm:EventToCommand Command="{Binding TextFocusCommand, Mode=OneWay}" />
                            </Custom:EventTrigger>
                        </Custom:Interaction.Triggers>
                    </TextBox>
                    <Slider Height="84" Value="{Binding Path=RefreshDuration, Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,360,0,0" Name="slider" VerticalAlignment="Top" Width="450" Maximum="12" LargeChange="2" Minimum="0.5" IsEnabled="{Binding ElementName=toggleSwitch, Path=IsChecked}"/>
                    <TextBlock Height="30" HorizontalAlignment="Left" Margin="0,330,0,0" Name="textBlock2" Text="{Binding ElementName=slider, Path=Value, StringFormat=间隔\{0\}小时刷新：}" VerticalAlignment="Top" />
                    <toolkit:ToggleSwitch Header="开启自动更新" Height="111" HorizontalAlignment="Left" Margin="0,220,0,0" Name="toggleSwitch" VerticalAlignment="Top" Width="456" IsChecked="{Binding Path=IsAutoRefresh, Mode=TwoWay}" FontWeight="Normal" FontFamily="Segoe WP">
                        <toolkit:ToggleSwitch.HeaderTemplate>
                            <DataTemplate>
                                <ContentControl Foreground="{StaticResource PhoneForegroundBrush}" Content="开启自动更新"/>
                            </DataTemplate>
                        </toolkit:ToggleSwitch.HeaderTemplate>
                        <Custom:Interaction.Triggers>
                            <Custom:EventTrigger EventName="Checked">
                                <Mvvm:EventToCommand
                                    Command="{Binding SwitchCommand}"/>
                            </Custom:EventTrigger>
                        </Custom:Interaction.Triggers>
                    </toolkit:ToggleSwitch>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>